
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib prefix="c" uri ="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href = "./static/layui/css/layui.css">

    <style>
        table{
            width: 800px !important;
            margin: 0 auto !important;
        }
        .layui-form-item{
            text-align: center;
        }
        .layui-form-item .layui-input-inline{
            float: none;
        }
    </style>
</head>
<body>
<form class="layui-form" method="post" action="dept?action=list">
    <div class="layui-form-item">
        <div class="layui-input-inline layui-input-wrap">
            <input type="text" name="dname" value="${condition.dname}" placeholder="请输入姓名" lay-verify="required" autocomplete="off" lay-affix="clear" class="layui-input">
        </div>
        <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">查询</button>
        <a class="layui-btn" href="addDept.jsp">新增用户</a>
    </div>
</form>
<table class="layui-table" lay-even>
    <colgroup>
        <col width="150">
        <col width="150">
        <col>
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>姓名</th>
        <th>操作</th>
    </tr>
    </thead>
<c:forEach items="${depts}" var="dept">
    <tr>
        <td>${dept.id}</td>
        <td>${dept.dname}</td>
        <td>
            <a href="dept?action=toupdate&id=${dept.id}">修改</a>
            <a href="dept?action=delete&id=${dept.id}">删除</a>
        </td>
    </tr>
</c:forEach>
</body>
</html>
